package com.kunyi.web.service.file.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kunyi.web.service.file.entity.domain.ExportRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @ClassName IDemoMapper
 * @Description export_request表交互
 * @Author pengjunjun
 * @Date 2024/03/04
 * @Version 1.0
 **/
@Repository
public interface IExportRequestMapper extends BaseMapper<ExportRequest> {
    int updateSuccessTotal(@Param("id") Long id, @Param("successNum") Integer successNum);

    default ExportRequest getByCode(String code){
        ExportRequest exportRequest = selectOne(Wrappers.lambdaQuery(ExportRequest.class)
                .eq(ExportRequest::getCode, code)
                .last(" limit 1 ")
        );
        return exportRequest;
    }
}
